////
////  YWebUIViewController.swift
////  YFree
////
////  Created by YMac on 2018/12/17.
////  Copyright © 2018 yangzhe. All rights reserved.
////
//import JavaScriptCore
//
//open class YWebUIViewController2: YUIViewController {
//    var js:YJSDelegate2?
//    
//    open override func yOnCreate() {
//        getWebView()!.scrollView.bounces = false
//        // getWebView()!.scrollView.contentInsetAdjustmentBehavior = .never
//        js = getJSDelegate()
//        getWebView()?.delegate = js!
//        if let htmlFile = Bundle.main.path(forResource: getWebName()!, ofType: "html") {
//            if let url = URL(string: "\(URL(fileURLWithPath: htmlFile).absoluteString)\(getParams())".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!){
//                getWebView()?.loadRequest(URLRequest(url: url))
//            }
//        }
//        //getWebView()!.loadRequest(URLRequest(url: URL(fileURLWithPath: Bundle.main.path(forResource: getWebName()!, ofType: "html")!)))
//    }
//    
//    open func getWebView() -> UIWebView? {
//        return getView(view: self.view)
//    }
//    
//    private func getView(view:UIView) -> UIWebView? {
//        for subView in view.subviews {
//            if subView is UIWebView {
//                return subView as? UIWebView
//            }
//            let _ = getView(view: subView)
//        }
//        return nil
//    }
//    
//    open func yEvaluateScript(_ script:String) {
//        getWebView()?.stringByEvaluatingJavaScript(from: script)
//    }
//    
//    open override func yOnDestory() {
//        getWebView()?.delegate = nil
//        getWebView()?.stopLoading()
//        getWebView()?.isHidden = true
//        //getWebView()?.removeFromSuperview()
//        js = nil
//    }
//    
//    open func getParams() -> String { return "" }
//    open func getJSDelegate() -> YJSDelegate2? { return YJSDelegate2() }
//    open func getWebName() -> String? { return nil }
//}
